<script type="text/javascript">
<!--

	$(function(){
		$('#basicInfoform').ajaxForm({ success: complete, dataType: 'json' });
	})

	function complete(data)
	{
		if(data._result == 'validate_sucess')
		{
			//提示成功
			$('#basicInfo_message').html('修改成功！');
			$('#basicInfo_message').show();
			setTimeout(ProfileAction._showDetailOfUser,2000);
		}
		else
		{
			$('#basicInfo_message').html(data._message);
			$('#basicInfo_message').show();
		}
	}
	
//-->
</script>
    <div id="basicInfo_detail" class="details panel opened">
        <h3 class="legend" id="basicInfo_display">
			基本信息
        </h3>
		<div style="display:none;" class=" ajax_msgerror messages_div" id="basicInfo_message"></div>
        <form class="panel" action="/index.php?r=profile/updateprofile" method="post" id="basicInfoform" name="basicInfoform">
            <p>
                <label for="name">
                    <span>
                        <em>
                            *
                        </em>
                        真实姓名:
                    </span>
                </label>
                <input type="text" class="input-text" name="ProfileForm[realname]" value="<?php echo $model->realname;?>" maxlength="12" >
            </p>
            <p>
                <label for="name">
                    <span>
                        昵称姓名:
                    </span>
                </label>
                <input type="text" class="input-text" name="ProfileForm[nickname]" value="<?php echo $model->nickname;?>" >
            </p>
            <p>
                <label for="gender">
                    <span>
                        <em>
                            *
                        </em>
                        性别:
                    </span>
                </label>
                <?php 
                	echo CHtml::radioButtonList("ProfileForm[sex]", $model->sex, array('男'=>'男生','女'=>'女生'),array('separator'=>'　'));
                ?>
                <!--
                <label class="labelRadio" for="gender2">
                    <input type="radio" id="gender2" checked="checked" value="男生" tabindex="2"
                    name="gender">
                    男
                </label>
                <label class="labelRadio" for="gender1">
                    <input type="radio" id="gender1" value="女生" tabindex="3" name="gender">
                    女
                </label>
                -->
            </p>
            <p>
                <label for="myProvince">
                    <span>
                        <em>
                            *
                        </em>
                        家乡:
                    </span>
                </label>
                <select name="ProfileForm[province]" id="province" class="cur-home select" onChange="initcity('province','towncity');">
             	<script type="text/javascript">creatprovince('province','towncity','<?php echo $model->province; ?>','<?php echo $model->towncity; ?>');</script>
                </select>
                <select name="ProfileForm[towncity]" id="towncity" class="select">
                    <option value="">选择城市</option>
                </select>
            </p>
            <p>
                <label style="birthyear">
                    <span>
                        *生日:
                    </span>
                </label>
                <span style="" id="birthDaySunSelect">
                	<?php
                		$_birthyear[''] = '选择年';
                		for ($i = 2012; $i >= 1970; $i--)
                			$_birthyear[$i] = $i;
                		echo CHtml::dropDownList('ProfileForm[birthyear]',$model->birthyear,$_birthyear,array('class'=>"select")); 
                	?>
					年
                	<?php
                		$_birthmonth[''] = '选择月';
                		for ($i = 1; $i <= 12; $i++)
                			$_birthmonth[$i] = $i;
                		echo CHtml::dropDownList('ProfileForm[birthmonth]',$model->birthmonth,$_birthmonth,array('class'=>"select")); 
                	?>
					月
                	<?php
                		$_birthday[''] = '选择日期';
                		for ($i = 1; $i <= 31; $i++)
                			$_birthday[$i] = $i;
                		echo CHtml::dropDownList('ProfileForm[birthday]',$model->birthday,$_birthday,array('class'=>"select")); 
                	?>
					日
                </span>
            </p>
            <p>
                <label for="" class="empty">
                    <span>
                        确认:
                    </span>
                </label>
                <input type="submit" name="submit" id="basicInfoSubmit" class="input-submit" value="保存修改" tabindex="10">
                <input type="button" onclick="ProfileAction._showDetailOfUser();" value="取消" class="input-submit gray" id="basicInfoCancel">
            </p>
        </form>
    </div>